// pages/act/actDiscover/actDiscover.js
let {
  api_GetCreditChangeRecords
} = require("../../api/getData.js")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currentTab: 0,
    totalPoints: 0,
    // dataSource: {
    dataSource: [{
        id: 1,
        content: "报名微沙龙",
        change: 1,
        totalScore: 81,
        updateTime: "2017/08/02 16:33"

      },
      {
        id: 2,
        content: "报名活动广场",
        totalScore: 82,
        change: 1,
        updateTime: "2017/08/02 16:33"

      },
      {
        id: 3,
        content: "发起微沙龙",
        totalScore: 83,
        change: 1,
        updateTime: "2017/08/02 16:33"

      },
      {
        id: 4,
        content: "点赞活动",
        totalScore: 84,
        change: 1,
        updateTime: "2017/08/02 16:33"

      },
    ]
    // }

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    console.log('#####################', options)
    let points = options.credit
    let params = {
      page: 1,
      size: 10
    }
    api_GetCreditChangeRecords(params, (res) => {
      console.log('信用分变更记录==>', res)
      this.setData({
        dataSource: res.data.list,
        totalPoints: points
      })

    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  },
  //点击切换

})